-LRB- CNN -RRB- -- A California transit officer shot and killed another officer Tuesday in an incident that authorities are calling a `` tragic accident . ''

The two Bay Area Rapid Transit police officers were conducting a search Tuesday afternoon of a Dublin apartment in connection with a spree of train robberies when the shooting occurred , according to Alameda County Sheriffs spokesman Sgt. J.D. Nelson .

During the search , the `` officer accidentally fired his weapon and struck and killed another officer , '' Nelson said . `` This appears to be a terrible and tragic accident . ''

The incident is being investigated .

BART Police Chief Kenton Rainey said he was `` deeply saddened '' by the incident .

The shooting marks the first death of a BART police officer in the agency 's history , CNN affiliate KGO reported .

BART train kills 2 workers near San Francisco

Gun safety instructor accidentally shoots student

CNN 's Janet DiGiacomo and Augie Martin contributed to this report .

@highlight

NEW : This marks the first fatal shooting of officer in transit agency 's history

@highlight

The shooting happened in connection with a search of an apartment

@highlight

Authorities are saying the shooting was an accident

@highlight

BART chief says he is `` deeply saddened ''